// 问答接口
import config from "./config";

var domain = config.getDomain;

var pageCount = config.getPageCount;

var DUIXIN_API =  domain + '/index.php?v=1&appid='+config.getAPPID+'&appsecret='+config.getAPPSECRET+'&';

export default  {
	// 问答导航
	getWenda_daohang(){
		var url = DUIXIN_API + '&s=wenda&c=daohang&m=index';
		return url;
	},
	// 问答列表
	getWenda_list(){
		var url = DUIXIN_API + '&s=wenda&c=list&m=index';
		return url;
	},
	// 问答详情
	getWenda_detail(){
		var url = DUIXIN_API + '&s=wenda&c=detail&m=index';
		return url;
	},
	// 问答提交
	postWenda(uid,code,id){
		var url = DUIXIN_API + '&s=member&app=wenda&c=home&m=add&api_auth_uid='+uid+'&api_auth_code='+code+'&catid='+id;
		return url;
	},
	//发布图id
	getFabuid(){
		var url = DUIXIN_API + '&s=wenda&c=fabu&m=fabuid';
		return url;
	},
	//上传图片多张
	postTupians(uid,code) {
		return DUIXIN_API+'s=api&c=file&m=upload&api_auth_uid='+uid+'&api_auth_code='+code+'&siteid=1';
	},
	// 列表
	getWenda_list(obj) {
		var url = DUIXIN_API + '&s=wenda&c=search&api_call_function=module_list&pagesize=' + pageCount + '&page=' + obj.page;
		if (obj.categories != 0) {
		  url += '&catid=' + obj.categories;
		} else if (obj.search != '') {
		  url += '&keyword=' + encodeURIComponent(obj.search);
		}
		return url;
	},
	// 列表
	getTiezi_list(obj) {
		var url = DUIXIN_API + '&s=wenda&c=liebiao&m=index&pagesize=' + pageCount + '&page=' + obj.page;
		if (obj.categories!= 0) {
		  url += '&catid=' + obj.categories;
		}
		return url;
	},
	// 点赞判断
	getDianzan_panduan(uid,code) {
		if(uid=='' || code==''){
			var url = DUIXIN_API + '&s=wenda&c=dianzan&m=dianzan_panduan';
		} else {
			var url = DUIXIN_API + '&s=member&app=wenda&c=dianzan&m=dianzan_panduan&api_auth_uid='+uid+'&api_auth_code='+code;
		}
		return url;
	},
	// 点赞
	postDianzan(uid,code) {
		var url = DUIXIN_API + '&s=member&app=wenda&c=dianzan&m=index&api_auth_uid='+uid+'&api_auth_code='+code;
		return url;
	},
	// 圈帖子点赞头像
	getDianzan_touxiang() {
		var url = DUIXIN_API + '&s=wenda&c=dianzan&m=dianzan_touxiang';
		return url;
	},
	// 问答页面信息
	getWenda(){
		var url = DUIXIN_API + '&s=wenda&c=wenda&m=index';
		return url;
	},
	// 回答提交
	postHuida(uid,code,id){
		var url = DUIXIN_API + '&s=wenda&c=comment&m=post&api_auth_uid='+uid+'&api_auth_code='+code+'&id='+id;
		return url;
	},
	// 回答提交
	postHuida_data(uid,code,id){
		var url = DUIXIN_API + '&s=member&app=wenda&c=daan&m=add&api_auth_uid='+uid+'&api_auth_code='+code+'&id='+id;
		return url;
	},
	// 答案列表
	getDaan_list_2(id){
		var url = DUIXIN_API + '&s=wenda&c=comment&id='+id;
		return url;
	},
	// 答案列表
	getDaan_list(obj){
		var url = DUIXIN_API + '&s=wenda&c=daan&m=index&pagesize=' + pageCount + '&page=' + obj.page + '&id=' + obj.categories;
		
		return url;
	},
	// 选择最佳答案
	postDaan_zuijia(uid,code,id){
		var url = DUIXIN_API + '&s=member&app=wenda&c=daan&m=zuijia&api_auth_uid='+uid+'&api_auth_code='+code+'&id='+id;
		return url;
	},
	// 答案详情
	getdaan_show(id){
		var url = DUIXIN_API + '&s=wenda&c=daan&m=daan_show&id='+id;
		return url;
	},
	
	
};